import 'package:flutter/material.dart';

class A extends StatefulWidget{

  @override
  State<StatefulWidget> createState() {
    return AState();
  }
 }

 class AState extends State<A>{
   @override
   void initState(){
     print('AState initState');
     super.initState();
   }

   @override
    Widget build(BuildContext ct){
      print('A build');
      return Scaffold(
        appBar: AppBar(
          title: Text('标题'),
          leading: FlatButton(
            child: Text('刷新'),
            onPressed: (){
              setState(() {
                
              });
            },
          ),
        ),
        body: Container(
          child: Center(
            child: AA(),
          ),
        ),
      );
    }
 }

 class AA extends StatefulWidget{
   @override
   State<StatefulWidget> createState() {
    return AAState();
  }
 }
class AAState extends State<AA>{
  @override
  void initState(){
    print('AAState initState');
    super.initState();
  }

  void didChangeDependencies(){
    print('AAState didChangeDependencies');
    super.didChangeDependencies();
  }

  @override
  void dispose(){
    print('AAState dipose');
    super.dispose();
  }

  @override
  Widget build(BuildContext context){
    print('AAState build');
    return Text('我是AAState');
  }
}
